package cn.itsource.romate.fallback;

import cn.itsource.result.R;
import cn.itsource.romate.api.PhoenixApi;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * 📖：beishan
 * 🗓️：2024/4/17 10:19
 * =====================
 */
@Component
public class PhoenixFallBack implements FallbackFactory<PhoenixApi> {
    @Override
    public PhoenixApi create(Throwable cause) {
        return new PhoenixApi() {
            @Override
            public R locationByOrderId(String orderId) {
                return R.error("真实里程计算失败");
            }
        };
    }
}
